package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

// 获取JSON对象
@RestController
public class JsonController {

    @RequestMapping("/getjson")
    public HashMap<String,String> getJson() {
        HashMap<String,String> map = new HashMap<>();
        map.put("小周","大一");
        map.put("小李","大二");
        map.put("小王","大三");
        return map;
    }
}
